// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by sidekick. DO NOT EDIT.
use crate::Result;

/// Implements a [Dataform](super::stub::Dataform) decorator for logging and tracing.
#[derive(Clone, Debug)]
pub struct Dataform<T>
where
    T: super::stub::Dataform + std::fmt::Debug + Send + Sync,
{
    inner: T,
}

impl<T> Dataform<T>
where
    T: super::stub::Dataform + std::fmt::Debug + Send + Sync,
{
    pub fn new(inner: T) -> Self {
        Self { inner }
    }
}

impl<T> super::stub::Dataform for Dataform<T>
where
    T: super::stub::Dataform + std::fmt::Debug + Send + Sync,
{
    #[tracing::instrument(ret)]
    async fn list_repositories(
        &self,
        req: crate::model::ListRepositoriesRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListRepositoriesResponse>> {
        self.inner.list_repositories(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_repository(
        &self,
        req: crate::model::GetRepositoryRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::Repository>> {
        self.inner.get_repository(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn create_repository(
        &self,
        req: crate::model::CreateRepositoryRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::Repository>> {
        self.inner.create_repository(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn update_repository(
        &self,
        req: crate::model::UpdateRepositoryRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::Repository>> {
        self.inner.update_repository(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_repository(
        &self,
        req: crate::model::DeleteRepositoryRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<()>> {
        self.inner.delete_repository(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn commit_repository_changes(
        &self,
        req: crate::model::CommitRepositoryChangesRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::CommitRepositoryChangesResponse>> {
        self.inner.commit_repository_changes(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn read_repository_file(
        &self,
        req: crate::model::ReadRepositoryFileRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ReadRepositoryFileResponse>> {
        self.inner.read_repository_file(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn query_repository_directory_contents(
        &self,
        req: crate::model::QueryRepositoryDirectoryContentsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::QueryRepositoryDirectoryContentsResponse>>
    {
        self.inner
            .query_repository_directory_contents(req, options)
            .await
    }

    #[tracing::instrument(ret)]
    async fn fetch_repository_history(
        &self,
        req: crate::model::FetchRepositoryHistoryRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::FetchRepositoryHistoryResponse>> {
        self.inner.fetch_repository_history(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn compute_repository_access_token_status(
        &self,
        req: crate::model::ComputeRepositoryAccessTokenStatusRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ComputeRepositoryAccessTokenStatusResponse>>
    {
        self.inner
            .compute_repository_access_token_status(req, options)
            .await
    }

    #[tracing::instrument(ret)]
    async fn fetch_remote_branches(
        &self,
        req: crate::model::FetchRemoteBranchesRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::FetchRemoteBranchesResponse>> {
        self.inner.fetch_remote_branches(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_workspaces(
        &self,
        req: crate::model::ListWorkspacesRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListWorkspacesResponse>> {
        self.inner.list_workspaces(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_workspace(
        &self,
        req: crate::model::GetWorkspaceRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::Workspace>> {
        self.inner.get_workspace(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn create_workspace(
        &self,
        req: crate::model::CreateWorkspaceRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::Workspace>> {
        self.inner.create_workspace(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_workspace(
        &self,
        req: crate::model::DeleteWorkspaceRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<()>> {
        self.inner.delete_workspace(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn install_npm_packages(
        &self,
        req: crate::model::InstallNpmPackagesRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::InstallNpmPackagesResponse>> {
        self.inner.install_npm_packages(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn pull_git_commits(
        &self,
        req: crate::model::PullGitCommitsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::PullGitCommitsResponse>> {
        self.inner.pull_git_commits(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn push_git_commits(
        &self,
        req: crate::model::PushGitCommitsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::PushGitCommitsResponse>> {
        self.inner.push_git_commits(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn fetch_file_git_statuses(
        &self,
        req: crate::model::FetchFileGitStatusesRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::FetchFileGitStatusesResponse>> {
        self.inner.fetch_file_git_statuses(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn fetch_git_ahead_behind(
        &self,
        req: crate::model::FetchGitAheadBehindRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::FetchGitAheadBehindResponse>> {
        self.inner.fetch_git_ahead_behind(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn commit_workspace_changes(
        &self,
        req: crate::model::CommitWorkspaceChangesRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::CommitWorkspaceChangesResponse>> {
        self.inner.commit_workspace_changes(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn reset_workspace_changes(
        &self,
        req: crate::model::ResetWorkspaceChangesRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ResetWorkspaceChangesResponse>> {
        self.inner.reset_workspace_changes(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn fetch_file_diff(
        &self,
        req: crate::model::FetchFileDiffRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::FetchFileDiffResponse>> {
        self.inner.fetch_file_diff(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn query_directory_contents(
        &self,
        req: crate::model::QueryDirectoryContentsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::QueryDirectoryContentsResponse>> {
        self.inner.query_directory_contents(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn search_files(
        &self,
        req: crate::model::SearchFilesRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::SearchFilesResponse>> {
        self.inner.search_files(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn make_directory(
        &self,
        req: crate::model::MakeDirectoryRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::MakeDirectoryResponse>> {
        self.inner.make_directory(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn remove_directory(
        &self,
        req: crate::model::RemoveDirectoryRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::RemoveDirectoryResponse>> {
        self.inner.remove_directory(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn move_directory(
        &self,
        req: crate::model::MoveDirectoryRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::MoveDirectoryResponse>> {
        self.inner.move_directory(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn read_file(
        &self,
        req: crate::model::ReadFileRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ReadFileResponse>> {
        self.inner.read_file(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn remove_file(
        &self,
        req: crate::model::RemoveFileRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::RemoveFileResponse>> {
        self.inner.remove_file(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn move_file(
        &self,
        req: crate::model::MoveFileRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::MoveFileResponse>> {
        self.inner.move_file(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn write_file(
        &self,
        req: crate::model::WriteFileRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::WriteFileResponse>> {
        self.inner.write_file(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_release_configs(
        &self,
        req: crate::model::ListReleaseConfigsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListReleaseConfigsResponse>> {
        self.inner.list_release_configs(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_release_config(
        &self,
        req: crate::model::GetReleaseConfigRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ReleaseConfig>> {
        self.inner.get_release_config(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn create_release_config(
        &self,
        req: crate::model::CreateReleaseConfigRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ReleaseConfig>> {
        self.inner.create_release_config(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn update_release_config(
        &self,
        req: crate::model::UpdateReleaseConfigRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ReleaseConfig>> {
        self.inner.update_release_config(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_release_config(
        &self,
        req: crate::model::DeleteReleaseConfigRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<()>> {
        self.inner.delete_release_config(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_compilation_results(
        &self,
        req: crate::model::ListCompilationResultsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListCompilationResultsResponse>> {
        self.inner.list_compilation_results(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_compilation_result(
        &self,
        req: crate::model::GetCompilationResultRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::CompilationResult>> {
        self.inner.get_compilation_result(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn create_compilation_result(
        &self,
        req: crate::model::CreateCompilationResultRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::CompilationResult>> {
        self.inner.create_compilation_result(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn query_compilation_result_actions(
        &self,
        req: crate::model::QueryCompilationResultActionsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::QueryCompilationResultActionsResponse>> {
        self.inner
            .query_compilation_result_actions(req, options)
            .await
    }

    #[tracing::instrument(ret)]
    async fn list_workflow_configs(
        &self,
        req: crate::model::ListWorkflowConfigsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListWorkflowConfigsResponse>> {
        self.inner.list_workflow_configs(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_workflow_config(
        &self,
        req: crate::model::GetWorkflowConfigRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::WorkflowConfig>> {
        self.inner.get_workflow_config(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn create_workflow_config(
        &self,
        req: crate::model::CreateWorkflowConfigRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::WorkflowConfig>> {
        self.inner.create_workflow_config(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn update_workflow_config(
        &self,
        req: crate::model::UpdateWorkflowConfigRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::WorkflowConfig>> {
        self.inner.update_workflow_config(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_workflow_config(
        &self,
        req: crate::model::DeleteWorkflowConfigRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<()>> {
        self.inner.delete_workflow_config(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_workflow_invocations(
        &self,
        req: crate::model::ListWorkflowInvocationsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListWorkflowInvocationsResponse>> {
        self.inner.list_workflow_invocations(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_workflow_invocation(
        &self,
        req: crate::model::GetWorkflowInvocationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::WorkflowInvocation>> {
        self.inner.get_workflow_invocation(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn create_workflow_invocation(
        &self,
        req: crate::model::CreateWorkflowInvocationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::WorkflowInvocation>> {
        self.inner.create_workflow_invocation(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_workflow_invocation(
        &self,
        req: crate::model::DeleteWorkflowInvocationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<()>> {
        self.inner.delete_workflow_invocation(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn cancel_workflow_invocation(
        &self,
        req: crate::model::CancelWorkflowInvocationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::CancelWorkflowInvocationResponse>> {
        self.inner.cancel_workflow_invocation(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn query_workflow_invocation_actions(
        &self,
        req: crate::model::QueryWorkflowInvocationActionsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::QueryWorkflowInvocationActionsResponse>> {
        self.inner
            .query_workflow_invocation_actions(req, options)
            .await
    }

    #[tracing::instrument(ret)]
    async fn get_config(
        &self,
        req: crate::model::GetConfigRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::Config>> {
        self.inner.get_config(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn update_config(
        &self,
        req: crate::model::UpdateConfigRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::Config>> {
        self.inner.update_config(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_locations(
        &self,
        req: location::model::ListLocationsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<location::model::ListLocationsResponse>> {
        self.inner.list_locations(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_location(
        &self,
        req: location::model::GetLocationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<location::model::Location>> {
        self.inner.get_location(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn set_iam_policy(
        &self,
        req: iam_v1::model::SetIamPolicyRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<iam_v1::model::Policy>> {
        self.inner.set_iam_policy(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_iam_policy(
        &self,
        req: iam_v1::model::GetIamPolicyRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<iam_v1::model::Policy>> {
        self.inner.get_iam_policy(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn test_iam_permissions(
        &self,
        req: iam_v1::model::TestIamPermissionsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<iam_v1::model::TestIamPermissionsResponse>> {
        self.inner.test_iam_permissions(req, options).await
    }
}
